package com.zhihuishu.micro.course.openapi.course;

import com.zhihuishu.micro.course.openapi.course.dto.CourseLessonVideoDto;
import com.zhihuishu.remote.RemoteException;
import com.zhihuishu.remote.RemoteResult;

import java.util.List;

/**
 * @author Jiangli
 * @date 2016/10/17 13:57
 */
public interface CourseLessonVideoOpenService {
    /**
     * 增加一个新的节视频
     * * courseId not null
     * * chapterId not null
     * * lessonId not null
     *  rank not null
     * @return
     * @throws RemoteException
     */
    RemoteResult<CourseLessonVideoDto> createByDto(CourseLessonVideoDto courseLessonVideoDto, long createUserId) throws RemoteException;
//    createData:默认true 代表找到root文件夹下的Course Videos文件夹，并且插入一条data数据
    RemoteResult<CourseLessonVideoDto> createByDto(CourseLessonVideoDto courseLessonVideoDto,Boolean createData, long createUserId) throws RemoteException;

    /**
     * 更新某节视频数据
     * @param lessonVideo
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> updateByDto(CourseLessonVideoDto lessonVideo ,long updateUserId) throws RemoteException ;

    /**
     * 删除某节视频
     * @param lessonVideoId
     * @param deleteUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> deleteById(Integer lessonVideoId , long deleteUserId) throws RemoteException;

    /**
     * 查询课程下的节视频列表
     * @param courseId
     * @return
     * @throws RemoteException
     */
    RemoteResult<List<CourseLessonVideoDto>> queryListByCourseId(long courseId) throws RemoteException ;

    RemoteResult<CourseLessonVideoDto> queryDetailByLvId(int lvId) throws RemoteException;

    /**
     * 更新节视频顺序
     * @param lessonVideoList
     * @param updateUserId
     * @return
     * @throws RemoteException
     */
    RemoteResult<Void> sortByDtoList(List<CourseLessonVideoDto> lessonVideoList ,long updateUserId) throws RemoteException ;
    /**
     * 视频所对应的节/小节添加缓存
     * @param videoId
     * @param lessonId
     * @param lesssonVideoId
     * @return
     */
    RemoteResult<Void> updateVideoIdRedis(Integer videoId,Integer lessonId,Integer lesssonVideoId);

}
